Skip to content

Fix Pino type imports and destination in evals logger - #1204

Open
nordicnode wants to merge 1 commit into
CodebuffAI:mainfrom
nordicnode:fix-evals-logger-types
Open

Fix Pino type imports and destination in evals logger#1204
nordicnode wants to merge 1 commit into
CodebuffAI:mainfrom
nordicnode:fix-evals-logger-types

Conversation

@nordicnode

Copy link
Copy Markdown

Fix Pino type imports and destination in evals logger

Summary

• Fixes TypeScript typechecking errors in evals/logger.ts where pino.destination and pino.LogFn caused 3 tsc compilation failures:

  • Property 'destination' does not exist on type 'typeof pino'
  • Namespace 'pino.pino' has no exported member 'LogFn' (x2)
    • In Pino v9, pino.destination resides on the default export (import pino from 'pino'), while LogFn is exported directly as a top-level type (import { type LogFn } from 'pino').
    • Updates logger.ts to import pino, { type LogFn } from 'pino' and reference Record<LogLevel, LogFn>.
    • Unlocks clean bun run --cwd evals typecheck (0 errors) across the evaluation benchmark harness.

Test plan

[✓] Ran bun run --cwd evals typecheck — 0 errors (previously 3 errors in logger.ts)
[✓] Verified runtime logging functions normally with pino.destination

@codebuff-team

Copy link
Copy Markdown
Contributor

Nice, minimal fix. Importing pino as a default export and pulling LogFn as a named type export matches Pino v9's actual module shape, and this correctly resolves the pino.LogFn / pino.destination typecheck errors described. The change is scoped exactly to the broken lines, doesn't touch unrelated code, and the reasoning in the PR body (namespace vs default export split in v9) is accurate and testable.

A couple of things worth double-checking before porting: it would help to confirm this doesn't break any other file that still does import { pino } from 'pino' expecting the old destructured shape - a quick repo-wide grep for from 'pino' would give confidence there's no ripple effect. Also, evals/logger.ts isn't covered by any existing tests, so the verification here rests on tsc passing plus manual runtime check - that's reasonable for a type-only fix but worth noting to whoever ports it.

Overall this is a legitimate, well-explained bugfix that's easy to review and low risk to port by hand.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree labels Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants